import request from "/@/utils/request"

export function fetchList(query?: Object) {
  return request({
    url: '/bms/deploy/dockerInfo/page',
    method: 'get',
    params: query
  })
}



export function getObj(id?: string) {
  return request({
    url: '/bms/deploy/dockerInfo/' + id,
    method: 'get'
  })
}


//
// export function delObjs(ids?: Object) {
//   return request({
//     url: '/bms/deploy/dockerInfo',
//     method: 'delete',
//     data: ids
//   })
// }
//

/**
 * 激活容器
 * @param obj
 */
export function active(obj?: Object) {
  return request({
    url: '/bms/deploy/dockerInfo/active',
    method: 'post',
    data: obj
  })
}


/**
 * 暂停容器
 * @param obj
 */
export function stop(id?: number) {
  return request({
    url: '/bms/deploy/dockerInfo/stop?id=' + id,
    method: 'get',
  })
}

/**
 * 开启容器
 * @param obj
 */
export function start(id?: number) {
  return request({
    url: '/bms/deploy/dockerInfo/start?id=' + id,
    method: 'get',
  })
}

/**
 * 废弃容器
 * @param obj
 */
export function remove(id?: number) {
  return request({
    url: '/bms/deploy/dockerInfo/remove?id=' + id,
    method: 'get',
  })
}
/**
 * 清理容器
 * @param obj
 */
export function clean(id?: number) {
  return request({
    url: '/bms/deploy/dockerInfo/clean?id=' + id,
    method: 'get',
  })
}

/**
 * 编辑容器
 * @param obj
 */
export function edit(obj?: Object) {
  return request({
    url: '/bms/deploy/dockerInfo/edit',
    method: 'put',
    data: obj
  })
}


/**
 * 复活容器
 * @param obj
 */
export function reborn(id?: number) {
  return request({
    url: '/bms/deploy/dockerInfo/reborn?id=' + id,
    method: 'get',
  })
}

/**
 * 升级容器
 * @param obj
 */
export function upgrade(obj?: Object) {
  return request({
    url: '/bms/deploy/dockerInfo/upgrade',
    method: 'post',
    data: obj
  })
}
